From: Debian Science Maintainers Date: Fri, 3 Jul 2026 21:13:01 +0000 (+0100) Subject: Ignore errors (but not wrong results) of solve_power X-Git-Tag: archive/raspbian/0.14.6+dfsg-3+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=16f6e2dd1fe372411d8f3a7808a3f6602a79d6f8;p=statsmodels.git Ignore errors (but not wrong results) of solve_power scipy.special.nctdtr returns NaN when rounding would otherwise make the result out of bounds: https://github.com/scipy/scipy/issues/25470 This has only been seen to fail the statsmodels test on armhf, but the underlying issue also exists on amd64 Author: Rebecca N. Palmer Forwarded: no Gbp-Pq: Name test_power_ignore_exception.patch --- diff --git a/statsmodels/stats/tests/test_power.py b/statsmodels/stats/tests/test_power.py index 5ae346f..d170b6d 100644 --- a/statsmodels/stats/tests/test_power.py +++ b/statsmodels/stats/tests/test_power.py @@ -83,8 +83,16 @@ class CheckPowerMixin: value = kwds[key] kwds[key] = None - result = self.cls().solve_power(**kwds) - assert_allclose(result, value, rtol=0.001, err_msg=key + " failed") + try: + result = self.cls().solve_power(**kwds) + except ValueError as err1: + # ignore failed brentq but not other errors + # not an xfail because we still want to try the other keys + print(key,value,kwds,err1) + if not "f(a) and f(b) must have different signs" in str(err1): + raise + else: + assert_allclose(result, value, rtol=0.001, err_msg=key + " failed") # yield can be used to investigate specific errors # yield assert_allclose, result, value, 0.001, 0, key+' failed' kwds[key] = value # reset dict